(defun KOMPLEKTS ();
	(PROG (cards)
	(SETQ cards '((6  Pi)(6  Er)(6  Kr)(6  Ka) 
             (7  Pi)(7  Er)(7  Kr)(7  Ka)
             (8  Pi)(8  Er)(8  Kr)(8  Ka) 
       		 (9  Pi)(9  Er)(9  Kr)(9  Ka)
			 (10 Pi)(10 Er)(10 Kr)(10 Ka)
             (V  Pi)(V  Er)(V  Kr)(V  Ka) 
			 (D  Pi)(D  Er)(D  Kr)(D  Ka)
             (K  Pi)(K  Er)(K  Kr)(K  Ka) 
			 (A  Pi)(A  Er)(A  Kr)(A  Ka)))
	(RETURN cards)
	)
)  
  
      
; teksta izvades funkcija, otrais parametrs (neobligaats) noraada
; vai liinijas beigaas paariet uz jaunu rindu vai nee
(defun p (str &optional(nl NIL) ) 
   (cond ((NULL nl) (format t "~a" str))
      (T (format t "~a~%" str))
   ))  
  
; pievieno X pirms N-taa elementa sarakstaa L
(DEFUN X_BEFOUR_N (L X N)
   	(COND
      		((NULL L) NIL)
      		((<= N 1) (CONS X L))
      		(T (CONS (FIRST L) (X_BEFOUR_N (REST L) X (- N 1))))
      	)
)


; sajauc kaartis kavaa
(DEFUN RANDOM_CARDS (L) (PROG (i LL)
      	(SETQ i 0)
      	(SETQ LL L)
      	LOOP
      		(SETQ i (+ i 1))
      		(cond
         			((< i 100) (SETQ LL (X_BEFOUR_N (REST LL) (FIRST LL) (+ (RANDOM 31) 1))))
         			(T (SETQ LL (X_BEFOUR_N (DEL LL (FIRST (LAST LL))) (FIRST (LAST LL)) (+ (RANDOM 31) 1))))
         		)
      		(COND
         			((= i 200) (GO CONT))
         			(T (GO LOOP))

         		)
      	CONT
      		(RETURN LL)
   ))


; nosaka ar kuru kaarti speeleetaajs izgaaja
(DEFUN CARD_NUM (L X) (PROG (N)
      	(SETQ N 0)
      	LOOP
      		(COND
         			((NULL L) (RETURN NIL))
         			((EQUAL X (FIRST L)) (RETURN N))
         		)
      		(SETQ L (REST L))
      		(SETQ N (+ N 1))
      	(GO LOOP)
   ))

; skaita cik ir kaartis
(DEFUN K_DAUDZUMS (L) (COND
      	((NULL L) 0)
      	(T (+ 1 (K_DAUDZUMS (REST L))))
   ))


; athriezh visas kaartis no masta kaads ir kaartij X
(DEFUN SAME_MASTS (L X) (COND
      	((NULL L) NIL)
      	((EQUAL (REST (FIRST L)) (REST X)) (APPEND (LIST (FIRST L)) (SAME_MASTS (REST L) X)))
      	(T (SAME_MASTS (REST L) X))
   ))

; panjemam katru 4 kaarti lai labaak tiktu nodroshinaata kavas sajaukshanaas
(DEFUN KATRS_OTRAJS (L)
   	(COND
      	((NULL L) NIL)
      	(T (CONS (FIRST L) (KATRS_OTRAJS (REST (REST (REST (REST L)))))))
   ))

; sadala kaartis speeleetaajiem
(DEFUN SADALIT(KOMPLEKTS) (PROG (HANDS)
      	(SETQ HANDS (LIST (KATRS_OTRAJS KOMPLEKTS)))
      	(SETQ HANDS (APPEND HANDS (LIST (KATRS_OTRAJS (REST KOMPLEKTS)))))
      	(SETQ HANDS (APPEND HANDS (LIST (KATRS_OTRAJS (REST (REST KOMPLEKTS))))))
      	(SETQ HANDS (APPEND HANDS (LIST (KATRS_OTRAJS (REST (REST (REST KOMPLEKTS)))))))
      	(RETURN HANDS)
   ))


; izguust n-to elementu no saraksta
(DEFUN NEMT_N (N HAND) (COND
      	((NULL HAND) NIL)
      	((EQUAL N 1) (COND 
            					((NULL (FIRST   HAND)) NIL)
            					(T (FIRST   HAND)))
         				 )
      	((EQUAL N 2) (COND 
            					((NULL (SECOND  HAND)) NIL)
            					(T (SECOND  HAND)))
         				 )
      	((EQUAL N 3) (COND 
            					((NULL (THIRD   HAND)) NIL)
            					(T (THIRD   HAND)))
         				 )
      	((EQUAL N 4) (COND 
            					((NULL (FOURTH  HAND)) NIL)
            					(T (FOURTH  HAND)))
         				 )
      	((EQUAL N 5) (COND 
            					((NULL (FIFTH   HAND)) NIL)
            					(T (FIFTH   HAND)))
         				 )
      	((EQUAL N 6) (COND 

            					((NULL (SIXTH   HAND)) NIL)
            					(T (SIXTH   HAND))) 
         				 )
      	((EQUAL N 7) (COND 
            					((NULL (SEVENTH HAND)) NIL)
            					(T (SEVENTH HAND)))
         				 )
      	((EQUAL N 8) (COND 
            					((NULL (EIGHTH  HAND)) NIL)
            					(T (EIGHTH  HAND))) 
         				 )
      	(T NIL)))

; speeleetaaja taktika	
(DEFUN SP_TAKTIKA (HAND TABLE NT IS26) (PROG (CARD CARDN)
      
	  (p "" T)
	  (p "--------------------------- Speletajs ") (p NT) (p "---------------------------" T)
      (p "Kartis uz galda: ") (COND((NULL TABLE)(p "nav" T)) (T (p TABLE T))) 
      (p "Jusu kartis: ") (p HAND T)
      
      LOOP
      (p "Izvelieties karti (1 - ") (p (K_DAUDZUMS hand)) (p ") : ")
      	(SETQ CARDN (READ))
      	(COND
         	((NULL CARDN) (go ERR1))
         	((NOT (NUMBERP CARDN)) (go ERR1))
         	(T (COND
               		((AND (> CARDN 0) (<= CARDN (K_DAUDZUMS HAND))) (SETQ CARD (NEMT_N CARDN HAND)))
               		(T (go ERR1))
               		))
         	)
      
      	(COND
         	(IS26 (COND 
               		((AND (= (K_DAUDZUMS TABLE) 0) (EQUAL (REST CARD) '(H)) (NOT (VISS_ER HAND)) ) (GO ERR3))
               		(T (GO CONT)))
            		)
         	(T (COND
               		((KPARBAUDE HAND CARD (FIRST TABLE)) (GO CONT))
               		(T (GO ERR2)))
            		)
         	)
      		
      	(GO LOOP)
      	
      	CONT

      		(RETURN CARD)
      		
      	ERR1
      (p "Kluda: Nepareizs kartes numurs!" T)
      		(GO LOOP)
      	ERR2
      		(p "Kluda: So karti saja gajiena nedrikst lietot!" T)
      		(GO LOOP)
      	ERR3
      (p "Kluda: Saja apaksspele nedrikst sakt ar Erca karti!")
      		(GO LOOP)
   ))

; nosaka vai visas kaartis ir erci
(DEFUN VISS_ER (L)
   	(COND
      	((NULL L) NIL)
      	(T (EQUAL (K_DAUDZUMS L) (K_DAUDZUMS (SAME_MASTS L (LIST '0 'ER)))))
      	)
)

; izlasa visas kaartis kas nav erci
(DEFUN NE_VISS_ER (L)
   	(COND

      	((NULL L) NIL)
      	((NOT (EQUAL (REST(FIRST L)) '(ER))) (APPEND (LIST (FIRST L)) (NE_VISS_ER (REST L))))
      	(T (NE_VISS_ER (REST L)))
      	)
)

; nosaka vai visas kaartis ir mazaakas par X veertiibu
(DEFUN MAZAK_X(L X)
   	(COND
      	((NULL L) NIL)
      	((< (K_TO_N (FIRST L)) (K_TO_N X)) (CONS (FIRST L) (MAZAK_X (REST L) X) ))
      	(T (MAZAK_X (REST L) X))
      	)
)

; atrod kaarti ar mazaako veertiibu
(DEFUN MIN_K (L)
   	(COND
      	((NULL L) NIL)
      	((NULL (REST L)) (FIRST L))
      	((> (K_TO_N (FIRST L)) (K_TO_N (FIRST (REST L)))) (MIN_K (REST L)))
      	((<= (K_TO_N (FIRST L)) (K_TO_N (FIRST (REST L)))) (MIN_K (CONS (FIRST L) (REST (REST L)))))
      	)
)


; atrod kaarti ar lielaako veertiibu
(DEFUN MAX_K (L)
   	(COND
      	((NULL L) NIL)
      	((NULL (REST L)) (FIRST L))
      	((< (K_TO_N (FIRST L)) (K_TO_N (FIRST (REST L)))) (MAX_K (REST L)))
      	((>= (K_TO_N (FIRST L)) (K_TO_N (FIRST (REST L)))) (MAX_K (CONS (FIRST L) (REST (REST L)))))
      	)
)

; paarveersh kaarts apziimeejumu par skaitli
(DEFUN K_TO_N (X)
   		(COND
      			((NUMBERP (FIRST X)) (FIRST X))
      			((EQUAL (FIRST X) 'V) 11)
      			((EQUAL (FIRST X) 'D) 12)
      			((EQUAL (FIRST X) 'K) 13)
      			((EQUAL (FIRST X) 'A) 14)
      		)
)

; paarbauda vai panjemtaas kaarts ziime ir vienaada ari gaajiena saakuma kaarts ziimi
(DEFUN KPARBAUDE (hand card first_on_table) 

   		(COND
      		((EQUAL (REST card) (REST first_on_table)) T) ; ja masti sakriit - T
      		(T (COND
            			((NULL first_on_table) T) ; ja uz galda nav nevienas kaarts - T
            			((IR_TADS_MASTS hand first_on_table) NIL) ; ja rokaa ir kaada kaarts ar prasiito mastu - NIL
            			(T T))))
)

; paarbauda vai rokaa ir kaada kaarts kuras masts sakriit ar prasiito (pirmo uz galda)
(DEFUN IR_TADS_MASTS (hand first_on_table)
   	(COND
      		((NULL hand) NIL)
      		((EQUAL (REST (FIRST hand)) (REST first_on_table)) T)
      		(T (IR_TADS_MASTS (REST hand) first_on_table))
      	)
)

; datora taktikas realizaacija
(DEFUN DATOR_TAKTIKA (HAND TABLE IS26) (COND
      
      ; ja uz galda nav nevienas kaarts
      ((= (K_DAUDZUMS TABLE) 0) (COND
            
            ; ja ir 2. vai 6. apakshspeele

            	(IS26 (COND
                  
                  ; ja rokaa nav neviena erca, liek mazaako kaarti
                  		((NULL (NE_VISS_ER HAND)) (MIN_K HAND))
                  
                  ; ja ir erci, tad liek mazaako, kas nav ercs
                  		(T (MIN_K (NE_VISS_ER HAND)))
                  
                  	))
            ; liek mazaako kaarti
            	(T (MIN_K HAND))
         ))
      
      ; ja nav nevienas kaarts no prasiitaa masta
      ; tad izveelas lielaako no taam kas ir rokaa
      ((NULL (SAME_MASTS HAND (FIRST TABLE))) (MAX_K HAND))
      
      
      ; ja ir kaartis no prasiitaa masta, tachu visas lielaakas par lielaako no attieciigaa masta kas ir uz galda
      ((NULL (MAX_K (MAZAK_X (SAME_MASTS HAND (FIRST TABLE)) (MAX_K (SAME_MASTS TABLE (FIRST TABLE)))))) (COND
            
            ; ja uz galda ir jau 3 kaartis, tad izveelas lielaako
            	((= (K_DAUDZUMS TABLE) 3) (MAX_K (SAME_MASTS HAND (FIRST TABLE))))
            

            ; ja nee, tad izveelas mazaako
            	(T (MIN_K (SAME_MASTS HAND (FIRST TABLE))))
            
         ))
      
      ; izveelas lielaako kaarti no prasiitaa masta, kas ir mazaaka par lielaako kaarti no attieciigaa masta uz galda
      (T (MAX_K (MAZAK_X (SAME_MASTS HAND (FIRST TABLE)) (MAX_K (SAME_MASTS TABLE (FIRST TABLE))))))
      
   ))

; datora taktika
(DEFUN DATOR_T (HAND TABLE NT IS26) (PROG (CARD)
	  (p "" T)
	  (p "---------------------------- Dators: ") (p NT ) (p "----------------------------" T)
      (p "Kaartis uz galda: ") (COND((NULL TABLE)(p "nav" T)) (T (p TABLE T))) 
      (SETQ CARD (DATOR_TAKTIKA HAND TABLE IS26))
      (p "Dators izvelejaas karti: ") (p CARD T)
      
      (RETURN CARD)
   ))

; dzeesh no kaartiim vienu kaarti
(DEFUN DEL (hand card)
   	(COND
      		((NULL hand) NIL)
      		((EQUAL (FIRST hand) card) (REST hand))
      		(T (CONS (FIRST hand) (DEL (REST hand) card)))
      	) 
)

; dzeesh n-taa speeleetaaja kaarti
(DEFUN DEL_SP_KARTI (HANDS X N)
   	(COND
      		((NULL HANDS) NIL) ; ja visas kaartis izspeeleetas nedara neko
      		((= N 0) (CONS (DEL (FIRST HANDS) X) (REST HANDS)))
      		(T (CONS (FIRST HANDS) (DEL_SP_KARTI (REST HANDS) X (- N 1))))
      	)
)

; realizee speeleetaaju gaajienus
(DEFUN SP_GAJIENI (HANDS TABLE NT IS26) (PROG (C)
      	(SETQ C 0)
      	LOOP
      		(COND
         			((= NT 0) (SETQ TABLE (APPEND TABLE (LIST (SP_TAKTIKA (FIRST HANDS) TABLE (+ NT 1) IS26)))))
         			((= NT 1) (SETQ TABLE (APPEND TABLE (LIST (SP_TAKTIKA (SECOND HANDS) TABLE (+ NT 1) IS26)))))

         			((= NT 2) (SETQ TABLE (APPEND TABLE (LIST (SP_TAKTIKA (THIRD HANDS) TABLE (+ NT 1) IS26)))))
         			((= NT 3) (SETQ TABLE (APPEND TABLE (LIST (DATOR_T (FOURTH HANDS) TABLE (+ NT 1) IS26)))))
         		)
      		(COND
         			((= C 3) (GO CONT))
         		)
      		(SETQ NT (+ NT 1))
      		(COND
         			((> NT 3) (SETQ NT (MOD NT 4)))
         		)
      		(SETQ C (+ C 1))
      	(GO LOOP)
      	CONT
      		(RETURN TABLE)
   ))

; sarakstaa L nomaina elementu ar nummuru N uz elementu X
(DEFUN MAINIT_N (L X N)
   	(COND
      		((NULL L) NIL)
      		((= N 1) (CONS X (REST L)))
      		(T (CONS (FIRST L) (MAINIT_N (REST L) X (- N 1))))
      	)
)


; saskaita ercus
(DEFUN ERCU_DAUDZUMS (L)
   	(COND
      		((NULL L) 0)
      		((EQUAL (REST (FIRST L)) '(ER)) (+ 1 (ERCU_DAUDZUMS (REST L))))
      		(T (ERCU_DAUDZUMS (REST L)))
      	)
)

; saskaita kalpus
(DEFUN KALPU_DAUDZUMS (L)
   	(COND
      		((NULL L) 0)
      		((EQUAL (FIRST (FIRST L)) 'V) (+ 1 (KALPU_DAUDZUMS (REST L))))
      		(T (KALPU_DAUDZUMS (REST L)))
      	)
)

; saskaita daamas
(DEFUN DAMU_DAUDZUMS (L)
   	(COND
      		((NULL L) 0)
      		((EQUAL (FIRST (FIRST L)) 'D) (+ 1 (DAMU_DAUDZUMS (REST L))))

      		(T (DAMU_DAUDZUMS (REST L)))
      	)
)

(DEFUN ROUNDA_NUM (L PN ROUND_NUMBER) (PROG (NT HANDS PLAYERN TABLE i SCORES IS26)
      	(SETQ i 0)
      	(SETQ HANDS  L)
      	(SETQ SCORES (LIST 0 0 0 0))
      	(SETQ NT PN)
      
      (COND
         ((= ROUND_NUMBER 2) (SETQ IS26 T))
         ((= ROUND_NUMBER 6) (SETQ IS26 T))
         (T (SETQ IS26 NIL))
      )
      (p "" T)
      (p "************************* ") (p ROUND_NUMBER) (p ". Apakshspeele *************************" T)
      (p "Speles noteikumi: " T)
	  
      (COND
         ((= ROUND_NUMBER 1)(p "  Nenemt stikus. Par katru panemto stiki 2 soda punkti." T))
         ((= ROUND_NUMBER 2)(p "  Nenemt ercus. Par katru panemto ercu, 2 soda punkti." T))
         ((= ROUND_NUMBER 3)(p "  Nenemt kalpus. Par katru panemto kalpu 4 soda punkti." T))
         ((= ROUND_NUMBER 4)(p "  Nenemt damas. Par katru panemto damu 4 soda punkti." T))
         ((= ROUND_NUMBER 5)(p "  Nenemt divus pedejos stikus. Par katru panemto stiki 8 soda punkti." T))
         ((= ROUND_NUMBER 6)(p "  Nenemt erca karali. Par panemsanu 16 soda punkti." T))
      )

      	LOOP
      		(SETQ i (+ 1 i))
      
      ; visi speeleetaaji izdara savu gaajienu
      		(SETQ TABLE (SP_GAJIENI HANDS NIL NT IS26))
      
      ; atrodam ciklaa zaudeejusho speeleetaaju (tam kam ir lielaakaa kaarts no prasiitaa masta)
      ; kaarts nummuram pieskaitam pirmaa speeleetaaja nummuru
      		(SETQ PLAYERN (+ (CARD_NUM TABLE (MAX_K (SAME_MASTS TABLE (FIRST TABLE)))) NT) )
      		(COND
         			((> PLAYERN 3) (SETQ PLAYERN (MOD PLAYERN 4)))
         		)
	  
      (COND
         ((= ROUND_NUMBER 1)( 
               SETQ SCORES (       
                  MAINIT_N SCORES (+ (NEMT_N (+ PLAYERN 1) SCORES) 2)
                  (+ PLAYERN 1)
               )
               		))
         ((= ROUND_NUMBER 2)(
               SETQ SCORES (       
                  MAINIT_N SCORES (  
                     +

                     (NEMT_N (+ PLAYERN 1) SCORES)
                     (* (ERCU_DAUDZUMS TABLE) 2)
                  )
                  (+ PLAYERN 1)
               )
            ))
         ((= ROUND_NUMBER 3)(
               SETQ SCORES (MAINIT_N SCORES (
                     +
                     (NEMT_N (+ PLAYERN 1) SCORES)
                     (* (KALPU_DAUDZUMS TABLE) 4)
                  )
                  (+ PLAYERN 1)
               )
            ))
         ((= ROUND_NUMBER 4)(
               SETQ SCORES (MAINIT_N SCORES (
                     +
                     (NEMT_N (+ PLAYERN 1) SCORES)
                     (* (DAMU_DAUDZUMS TABLE) 4)
                  )
                  (+ PLAYERN 1)
               )
            ))

         ((= ROUND_NUMBER 5)(COND
               			((>= i 7) ( ; ja ir pirmspeedeejais vai peedeejais stikjis
                     SETQ SCORES (MAINIT_N SCORES (
                           + (NEMT_N (+ PLAYERN 1) SCORES) 8
                        )
                        (+ PLAYERN 1)
                     )
                  ))
               		 ))
         ((= ROUND_NUMBER 6)(COND
               
               ; ja uz galda ir karalis, tad zaudeetaajam +16 punkti
               			((NOT (NULL (CARD_NUM TABLE (LIST 'K 'ER)))) (
                     SETQ SCORES (MAINIT_N SCORES 16 (+ PLAYERN 1)))
               )
            ))
         
      )
      
      
      		(SETQ HANDS (DEL_SP_KARTI HANDS (FIRST  TABLE) NT))
      		(SETQ HANDS (DEL_SP_KARTI HANDS (SECOND TABLE) (MOD (+ NT 1) 4)))
      		(SETQ HANDS (DEL_SP_KARTI HANDS (THIRD  TABLE) (MOD (+ NT 2) 4)))
      		(SETQ HANDS (DEL_SP_KARTI HANDS (FOURTH TABLE) (MOD (+ NT 3) 4)))

      
      (p "" T)
	  (p "******************************************************************" T)
      ;(p " Aplja beigas, pirmais gaja speletajs ar nr: ") (p (+ NT 1) T)
      ;(p " Uz galda bija kartis: ") (p TABLE T)
      (p " Apli zaudeja speletajs: ") (p (+ PLAYERN 1) T)
      (p "******************************************************************" T)
      
      ; naakamais ies speeleetaajs kursh zaudeeja
      		(SETQ NT PLAYERN)
      	(COND
         		((= i 8) (go CONT))
         		(T (go LOOP))
         	)
      	CONT
      		(RETURN SCORES)
   ))
   
; pieskaita speeles rezultaatiem (L2) apakshspeeles rezultaatus (L1)
(DEFUN PLUS_PUNKTI (L1 L2)

   	(LIST (+ (FIRST L1) (FIRST L2)) (+ (SECOND L1) (SECOND L2)) (+ (THIRD L1) (THIRD L2)) (+ (FOURTH L1) (FOURTH L2)))
)

(DEFUN KING_SPELE (KOMPLEKTS) (PROG (GAME_SCORES)
      
      	(SETQ GAME_SCORES (LIST 0 0 0 0))
      	
      
      	(SETQ GAME_SCORES (PLUS_PUNKTI (ROUNDA_NUM (SADALIT (RANDOM_CARDS KOMPLEKTS)) 0 1) GAME_SCORES))
      (p "Apaksspeles rezultati: ") (p GAME_SCORES T)
      	
      	(SETQ GAME_SCORES (PLUS_PUNKTI (ROUNDA_NUM (SADALIT (RANDOM_CARDS KOMPLEKTS)) 1 2) GAME_SCORES))
      (p "Apaksspeles rezultati: ") (p GAME_SCORES T)
      	
      	(SETQ GAME_SCORES (PLUS_PUNKTI (ROUNDA_NUM (SADALIT (RANDOM_CARDS KOMPLEKTS)) 2 3) GAME_SCORES))
      (p "Apaksspeles rezultati: ") (p GAME_SCORES T)
      	
      	(SETQ GAME_SCORES (PLUS_PUNKTI (ROUNDA_NUM (SADALIT (RANDOM_CARDS KOMPLEKTS)) 3 4) GAME_SCORES))
      (p "Apaksspeles rezultati: ") (p GAME_SCORES T)
      
      	(SETQ GAME_SCORES (PLUS_PUNKTI (ROUNDA_NUM (SADALIT (RANDOM_CARDS KOMPLEKTS)) 0 5) GAME_SCORES))
      (p "Apaksspeles rezultati: ") (p GAME_SCORES T)
      
      	(SETQ GAME_SCORES (PLUS_PUNKTI (ROUNDA_NUM (SADALIT (RANDOM_CARDS KOMPLEKTS)) 1 6) GAME_SCORES))

      (p "Apaksspeles rezultati: ") (p GAME_SCORES T)
      
      
      
      	(p "Spele uzvareja ")
      	(COND
         ((= (MIN (FIRST GAME_SCORES) (SECOND GAME_SCORES) (THIRD GAME_SCORES) (FOURTH GAME_SCORES)) (FIRST  GAME_SCORES)) (p "1"))
         ((= (MIN (FIRST GAME_SCORES) (SECOND GAME_SCORES) (THIRD GAME_SCORES) (FOURTH GAME_SCORES)) (SECOND GAME_SCORES)) (p "2"))
         ((= (MIN (FIRST GAME_SCORES) (SECOND GAME_SCORES) (THIRD GAME_SCORES) (FOURTH GAME_SCORES)) (THIRD  GAME_SCORES)) (p "3"))
         ((= (MIN (FIRST GAME_SCORES) (SECOND GAME_SCORES) (THIRD GAME_SCORES) (FOURTH GAME_SCORES)) (FOURTH GAME_SCORES)) (p "4"))
         	)
      	(p ". speletajs!" T)
   )
)

(DEFUN KING();
	(prog(
			(command 0)
		)
		(p "------------------------------------------------------------------" T)
		(p "---------------------------- Spele KING --------------------------" T)
		_Menu
		(p "------------------------------------------------------------------" T)
		(p "    1 - Sakt jaunu speli" T)
		(p "    2 - Par izstradatajiem" T)
		(p "    3 - Beigt speli" T)
		(p "------------------------------------------------------------------" T)
		(setq command (read))
            (cond
                ((eq command 1) (KING_SPELE (KOMPLEKTS)))
                ((eq command 2) (format T "Autori:~%  Natalija Dudareva~%  Anatolijs Dudanovskis~%  Vladimirs Ambrosovs~%  Aleksejs Kolosovs~%"))
                ((eq command 3) (return 0))
                (t (p "Kluda: Nepareiza komanda, atkartojiet vel reiz" T))
            )
        (go _Menu)
	)
)

